package com.woniuxy.service06;

import org.springframework.beans.factory.BeanNameAware;

/**
 * @author 佘赛飞
 * @create 2021 -11 -04 5:28 PM
 */
public class SomeServiceImpl implements SomeService, BeanNameAware {

    //调用BeanNameAware的setBeanName()
    //传递Bean的ID。
    @Override
    public void setBeanName(String name) {

        System.out.println("BeanNameAware,获取BeanName:"+name);
    }

    String name;

    public String getName() {
        return name;
    }


    public void setName(String name) {
        System.out.println("属性赋值");
        this.name = name;
    }

    public SomeServiceImpl() {
        System.out.println("SomeService构造器执行");
    }

    @Override
    public void doSome() {
        System.out.println("SomeServiceImpl--doSome");
    }


    public void  setUp(){

        System.out.println("bean初始化.....setUp");
    }

    public void  tearDown(){

        System.out.println("即将销毁....tearDown");
    }


}
